background-color: #4c4c4c;
}
-.popup-menu-item:insensitive {
+StButton.popup-menu-item:insensitive {
color: #9f9f9f;
}
padding: 4px 32px 5px;
}
-.modal-dialog-button:disabled {
+.modal-dialog-button:insensitive {
color: rgb(60, 60, 60);
}
return;
button.reactive = sensitive;
- if (sensitive)
- button.remove_style_pseudo_class('insensitive');
- else
- button.add_style_pseudo_class('insensitive');
},
setUrgency: function(urgency) {
this.sensitive = sensitive;
this.actor.reactive = sensitive;
- if (sensitive)
- this.actor.remove_style_pseudo_class('insensitive');
- else
- this.actor.add_style_pseudo_class('insensitive');
this.emit('sensitive-changed', sensitive);
},
}
item.actor.reactive = action.enabled;
- if (action.enabled)
- item.actor.remove_style_pseudo_class('insensitive');
- else
- item.actor.add_style_pseudo_class('insensitive');
destroyId = item.connect('destroy', Lang.bind(this, function() {
item.disconnect(destroyId);
for (let i = 0; i < action.items.length; i++) {
let item = action.items[i];
item.actor.reactive = action.enabled;
-
- if (action.enabled)
- item.actor.remove_style_pseudo_class('insensitive');
- else
- item.actor.add_style_pseudo_class('insensitive');
}
}
}
G_TYPE_INT);
}
-static void
-notify_reactive_cb (StWidget *button)
-{
- if (clutter_actor_get_reactive (CLUTTER_ACTOR (button)))
- st_widget_remove_style_pseudo_class (button, "disabled");
- else
- st_widget_add_style_pseudo_class (button, "disabled");
-}
-
static void
st_button_init (StButton *button)
{
clutter_actor_set_reactive (CLUTTER_ACTOR (button), TRUE);
st_widget_set_track_hover (ST_WIDGET (button), TRUE);
-
- g_signal_connect(button, "notify::reactive",
- G_CALLBACK (notify_reactive_cb), NULL);
}
/**
st_widget_style_changed (widget);
}
+static void
+st_widget_reactive_notify (StWidget *widget,
+ GParamSpec *pspec,
+ gpointer data)
+{
+ if (clutter_actor_get_reactive (CLUTTER_ACTOR (widget)))
+ st_widget_remove_style_pseudo_class (widget, "insensitive");
+ else
+ st_widget_add_style_pseudo_class (widget, "insensitive");
+}
+
static void
st_widget_first_child_notify (StWidget *widget,
GParamSpec *pspec,
/* connect style changed */
g_signal_connect (actor, "notify::name", G_CALLBACK (st_widget_name_notify), NULL);
+ g_signal_connect (actor, "notify::reactive", G_CALLBACK (st_widget_reactive_notify), NULL);
g_signal_connect (actor, "notify::first-child", G_CALLBACK (st_widget_first_child_notify), NULL);
g_signal_connect (actor, "notify::last-child", G_CALLBACK (st_widget_last_child_notify), NULL);